package com.example.birdfriends.dao;

import com.example.birdfriends.pojo.user.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import javax.jws.soap.SOAPBinding;
import java.util.List;

// 用户处理，包括查询，登录，注册
@Mapper
public interface UserDao {
    public int insertUser(User user);
    public User findUserByEmailAndPassword(@Param("email") String nickname, @Param("password") String password);
    public User findUserByEmail(@Param("email") String email);
    public int deleteUser(@Param("id") Long id);
    public int updateUser(User user);
    public int updatePassword(@Param("password") String password, @Param("email") String email);
    public List<Long> findAllUserIds();  // 查找所有用户
    public List<Long> findUserIdsOrderById();  // 查找所有用户
    public User findUserById(@Param("uid") Long uid);
    public List<User> findUsersByName(@Param("name") String name);
    public Long countUserNumber();
}
